Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

fs: fix ReadStream / WriteStream fd leaks #4405

Closed
wants to merge 2 commits into from

Conversation

bnoordhuis
Copy link
Member

Fixes #4387. The PR is against master but it probably should go into v0.8.

Reviewer: @isaacs

@isaacs
Copy link

isaacs commented Dec 11, 2012

Minor nit about setting this.fd = null, but otherwise LGTM. (If there's some reason not to do that, then that's probably fine, too; it's an edge case.)

Close the file descriptor when a read operation fails.

Fixes nodejs#4387.
Close the file descriptor when a write operation fails.

Fixes nodejs#4387.
@bnoordhuis
Copy link
Member Author

Landed in v0.8 in 6e97b2c and d65832c.

@bnoordhuis bnoordhuis closed this Dec 12, 2012
@isaacs
Copy link

isaacs commented Dec 15, 2012

@bnoordhuis Can you review 4791c32 and let me know if you think it's still a valid test for this issue?

The timing of events in fd streams is a bit different in streams2, so the test needed a bit of refactoring.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants